<template>
	<view class="indexbox">
		<!-- <basics v-if="PageCur=='home'"></basics>
		<components v-if="PageCur=='component'"></components>
		<plugin v-if="PageCur=='plugin'"></plugin> -->
		<home v-if="PageCur=='home'" class="pd-buttom" v-on:jumpCode="jumpCode"></home>
		<custome v-if="PageCur=='custome'" class="pd-buttom"></custome>
		<privilege v-if="PageCur=='privilegeVIP'" class="pd-buttom"></privilege>
		<view class="cu-bar tabbar bg-white shadow foot">
			<view class="action" @click="NavChange" data-cur="home">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/basics' + [PageCur=='home'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='home'?'text-green':'text-gray'">VIP取图群</view>
			</view>
			<view class="action" @click="NavChange" data-cur="custome">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/component' + [PageCur == 'custome'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='custome'?'text-green':'text-gray'">联系客服</view>
			</view>
			<view class="action" @click="NavChange" data-cur="privilegeVIP">
				<view class='cuIcon-cu-image'>
					<image :src="'/static/tabbar/privilegeVIP' + [PageCur == 'privilegeVIP'?'_cur':''] + '.png'"></image>
				</view>
				<view :class="PageCur=='privilegeVIP'?'text-green':'text-gray'">VIP特权</view>
			</view>
		</view>
	</view>
</template>
<script>
import Home from '../home/home.vue'
import Custome from '../custome/custome.vue'
import Privilege from '../privilegeVIP/privilegeVIP.vue'
	export default {
		components: {
			Home,
			Custome,
			Privilege,
		},
		data() {
			return {
				PageCur: 'home'
			}
		},
		methods: {
			jumpCode (item) {
				this.PageCur = 'privilegeVIP'
				uni.setStorage({
					key: 'codeId',
					data: item
				});
			},
			NavChange: function(e) {
					uni.setStorage({
					    key: 'codeId',
					    data: ''
					});
				this.PageCur = e.currentTarget.dataset.cur
			}
		}
	}
</script>    

<style>
.pd-buttom{
	padding-bottom: 100rpx;
}
.indexbox{
	padding-top: constant(safe-area-inset-top);
}
.uni-page-wrapper{
	background-color: #FFFFFF;
}
</style>
